<?php
	require_once 'classdb.php';
		
		
	class seo_tour extends db {    
    public function seo($view,$bb=-1,$lang,$cc,$dd,$ee,$ff)
    {	
        $array= array();
		$seo1=$this->get_by_thutu('seo');
		while($row=mysql_fetch_array($seo1)){
		$list[$row["id"]]=$row;
    	}
		if($view==1)
        {  
		   $array['keyword']=$list[$view]['keyword'];
		   $array['description']=$list[$view]['description'];
		   $array['title']=$list[$view]['title'];
		   return $array;
		}
		elseif($view==2)
        {  
		   $array['keyword']=$list[$view]['keyword'];
		   $array['description']=$list[$view]['description'];
		   $array['title']=$list[$view]['title'];
		   return $array;
		}
		elseif($view==3)
        {  
		   $array['keyword']=$list[$view]['keyword'];
		   $array['description']=$list[$view]['description'];
		   $array['title']=$list[$view]['title'];
		   return $array;
		}
		elseif($view==4)
        {  
		   $array['keyword']=$list[$view]['keyword'];
		   $array['description']=$list[$view]['description'];
		   $array['title']=$list[$view]['title'];
		   return $array;
		}
		elseif($view==5)
        {  
		   $array['keyword']=$list[$view]['keyword'];
		   $array['description']=$list[$view]['description'];
		   $array['title']=$list[$view]['title'];
		   return $array;
		}
		elseif($view==6)
        {  
		   $array['keyword']=$list[$view]['keyword'];
		   $array['description']=$list[$view]['description'];
		   $array['title']=$list[$view]['title'];
		   return $array;
		}
		elseif($view==7)
        {  
		   $array['keyword']=$list[$view]['keyword'];
		   $array['description']=$list[$view]['description'];
		   $array['title']=$list[$view]['title'];
		   return $array;
		}
		
		elseif($view==8)
        {  
		   $array['keyword']=$list[$view]['keyword'];
		   $array['description']=$list[$view]['description'];
		   $array['title']=$list[$view]['title'];
		   return $array;
		}
		elseif($view==9)
        {  
		   $array['keyword']=$list[$view]['keyword'];
		   $array['description']=$list[$view]['description'];
		   $array['title']=$list[$view]['title'];
		   return $array;
		}
		elseif($view==10)
        {  
		   $array['keyword']=$list[$view]['keyword'];
		   $array['description']=$list[$view]['description'];
		   $array['title']=$list[$view]['title'];
		   return $array;
		}
		elseif($view==11)
        {  
		   $array['keyword']=$list[$view]['keyword'];
		   $array['description']=$list[$view]['description'];
		   $array['title']=$list[$view]['title'];
		   return $array;
		}
		elseif($view==12)
        {  
		   $array['keyword']=$list[$view]['keyword'];
		   $array['description']=$list[$view]['description'];
		   $array['title']=$list[$view]['title'];
		   if(is_numeric($dd))
		   {
		   	   $res=$this->get_by_thutu("sanpham_chungloai",$dd);
			   $row_seo=mysql_fetch_assoc($res);
			   if($row_seo['title']!='') $array['title']=$row_seo['title'];
			   if($row_seo['title']=='') $array['title']=$row_seo['ten_'.$lang];
			   if($row_seo['keyword']!='') $array['keyword']=$row_seo['keyword'];
			   if($row_seo['description']!='') $array['description']=$row_seo['description'];
			   return $array;
		   }
		   else{
			   return $array;
		   }
		}
		elseif($view==13)
        {  
		   $array['keyword']=$list[$view]['keyword'];
		   $array['description']=$list[$view]['description'];
		   $array['title']=$list[$view]['title'];
		   if(is_numeric($cc))
		   {
		   	   $res=$this->get_by_thutu("sanpham_root",$cc);
			   $row_seo=mysql_fetch_assoc($res);
			   if($row_seo['title']!='') $array['title']=$row_seo['title'];
			   if($row_seo['title']=='') $array['title']=$row_seo['ten_'.$lang];
			   if($row_seo['keyword']!='') $array['keyword']=$row_seo['keyword'];
			   if($row_seo['description']!='') $array['description']=$row_seo['description'];
			   return $array;
		   }
		   else{
			   return $array;
		   }
		}
		elseif($view==14)
        {  
		   $array['keyword']=$list[$view]['keyword'];
		   $array['description']=$list[$view]['description'];
		   $array['title']=$list[$view]['title'];
		   if(is_numeric($ee))
		   {
		   	   $res=$this->get_by_thutu("sanpham_loai",$ee);
			   $row_seo=mysql_fetch_assoc($res);
			   if($row_seo['title']!='') $array['title']=$row_seo['title'];
			   if($row_seo['title']=='') $array['title']=$row_seo['ten_'.$lang];
			   if($row_seo['keyword']!='') $array['keyword']=$row_seo['keyword'];
			   if($row_seo['description']!='') $array['description']=$row_seo['description'];
			   return $array;
		   }
		   else{
			   return $array;
		   }
		}
		elseif($view==15)
        {  
		   $array['keyword']=$list[$view]['keyword'];
		   $array['description']=$list[$view]['description'];
		   $array['title']=$list[$view]['title'];
		   if(is_numeric($ff))
		   {
		   	   $res=$this->get_by_thutu("sanpham",$ff);
			   $row_seo=mysql_fetch_assoc($res);
			   if($row_seo['title']!='') $array['title']=$row_seo['title'];
			   if($row_seo['title']=='') $array['title']=$row_seo['ten_'.$lang];
			   if($row_seo['keyword']!='') $array['keyword']=$row_seo['keyword'];
			   if($row_seo['description']!='') $array['description']=$row_seo['description'];
			   return $array;
		   }
		   else{
			   return $array;
		   }
		}
		elseif($view==16)
        {  
		   $array['keyword']=$list[$view]['keyword'];
		   $array['description']=$list[$view]['description'];
		   $array['title']=$list[$view]['title'];
		   if(is_numeric($bb))
		   {
		   	   $res=$this->get_by_thutu("tin_loai",$bb);
			   $row_seo=mysql_fetch_assoc($res);
			   if($row_seo['title']!='') $array['title']=$row_seo['title'];
			   if($row_seo['title']=='') $array['title']=$row_seo['ten_'.$lang];
			   if($row_seo['keyword']!='') $array['keyword']=$row_seo['keyword'];
			   if($row_seo['description']!='') $array['description']=$row_seo['description'];
			   return $array;
		   }
		   else{
			   return $array;
		   }
		}
		elseif($view==17)
        {  
		   $array['keyword']=$list[$view]['keyword'];
		   $array['description']=$list[$view]['description'];
		   $array['title']=$list[$view]['title'];
		   if(is_numeric($cc))
		   {
		   	   $res=$this->get_by_thutu("tin",$cc);
			   $row_seo=mysql_fetch_assoc($res);
			   if($row_seo['title']!='') $array['title']=$row_seo['title'];
			   if($row_seo['title']=='') $array['title']=$row_seo['ten_'.$lang];
			   if($row_seo['keyword']!='') $array['keyword']=$row_seo['keyword'];
			   if($row_seo['description']!='') $array['description']=$row_seo['description'];
			   return $array;
		   }
		   else{
			   return $array;
		   }
		}
		elseif($view==18)
        {  
		   $array['keyword']=$list[$view]['keyword'];
		   $array['description']=$list[$view]['description'];
		   $array['title']=$list[$view]['title'];
		   return $array;
		}
		elseif($view==19)
        {  
		   $array['keyword']=$list[$view]['keyword'];
		   $array['description']=$list[$view]['description'];
		   $array['title']=$list[$view]['title'];
		   return $array;
		}
		elseif($view==20)
        {  
		   $array['keyword']=$list[$view]['keyword'];
		   $array['description']=$list[$view]['description'];
		   $array['title']=$list[$view]['title'];
		   return $array;
		}
		elseif($view==21)
        {  
		   $array['keyword']=$list[$view]['keyword'];
		   $array['description']=$list[$view]['description'];
		   $array['title']=$list[$view]['title'];
		   return $array;
		}
		elseif($view==22)
        {  
		   $array['keyword']=$list[$view]['keyword'];
		   $array['description']=$list[$view]['description'];
		   $array['title']=$list[$view]['title'];
		   return $array;
		}
		elseif($view==23)
        {  
		   $array['keyword']=$list[$view]['keyword'];
		   $array['description']=$list[$view]['description'];
		   $array['title']=$list[$view]['title'];
		   return $array;
		}
		elseif($view==24)
        {  
		   $array['keyword']=$list[$view]['keyword'];
		   $array['description']=$list[$view]['description'];
		   $array['title']=$list[$view]['title'];
		   return $array;
		}
		elseif($view==25)
        {  
		   $array['keyword']=$list[$view]['keyword'];
		   $array['description']=$list[$view]['description'];
		   $array['title']=$list[$view]['title'];
		   return $array;
		}
		elseif($view==26)
        {  
		   $array['keyword']=$list[$view]['keyword'];
		   $array['description']=$list[$view]['description'];
		   $array['title']=$list[$view]['title'];
		   return $array;
		}
		
        if($view==1||$view=='')
        {  
		   $array['keyword']=$list['1']['keyword'];
		   $array['description']=$list['1']['description'];
		   $array['title']=$list['1']['title'];
		   return $array;
        }
    }
}
?>